//
//  FP_UserPriceInquiryInfoCell.m
//  FootPad
//
//  Created by 张浩 on 2022/2/17.
//  Copyright © 2022 胶享悦. All rights reserved.
//

#import "MM_HomeSearchLeftCell.h"

@interface MM_HomeSearchLeftCell ()

@property (nonatomic, strong) UIView *baseView;
@property (nonatomic, strong) UILabel *nameLabel;
//@property (nonatomic, strong) UIView *lineView;

@end

@implementation MM_HomeSearchLeftCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        _baseView = [[UIView alloc] init];
        _baseView.backgroundColor = [ColorUtil colorWithHexadecimal:@"#ffffff"];
        [self.contentView addSubview:_baseView];
        
        _nameLabel = [Custom_ZHTool uiLabelCreate:@"" Font:FONT(14) TextColor:MM_ColorUtil(@"#333333")];
        [self.baseView addSubview:_nameLabel];
        
//        _lineView = [[UIView alloc] init];
//        _lineView.backgroundColor = [ColorUtil colorWithHexadecimal:@"#eeeeee"];
//        [self.baseView addSubview:_lineView];

        [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.left.right.top.bottom.equalTo(self.contentView);
            make.height.equalTo(40);
        }];
        
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.centerX.centerY.equalTo(self.baseView);
        }];
        
//        [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
//           
//            make.left.right.equalTo(self.baseView);
//            make.bottom.equalTo(0);
//            make.height.equalTo(1);
//        }];
        
    }
    return self;
}

- (void)setModel:(MM_HomeSearchLeftModel *)model {
    _model = model;
    
    self.nameLabel.text = [NSString stringWithFormat:@"%@-%@",model.warehouse_name,model.area_name];
    
    if (model.is_Selected) {
        self.baseView.backgroundColor = MM_ColorUtil(@"#1F71C4");
    } else {
        self.baseView.backgroundColor = MM_ColorUtil(@"#ffffff");
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
